<?php
namespace app\admin\controller;


/**
 * @title 栏目信息
 * @description 接口说明
 * @group admin
 * @header name:authorization require:1 default: desc:登陆的token
 */
class ColumnInfo extends Base
{
    protected $_order = 'id desc';

    /**
     * @title 获取
     * @description 接口说明
     * @author hardy
     * @url /admin/ColumnInfo
     * @method GET
     *
     * @return term:专家团队
     * @return term_cover:专家团队配图
     * @return work:工作环境
     * @return work_cover:工作环境图片
     */
    public function gets()
    {
        $this->getOne(1, $this->controller);
    }
    public function create(){}
    /**
     * @title 修改
     * @description 接口说明
     * @author hardy
     * @url /admin/ColumnInfo
     * @method put
     *
     *
     * @param name:term type:string require:1 default: other: desc:专家团队
     * @param name:term_cover type:string require:1 default: other: desc:专家团队配图
     * @param name:work type:string require:1 default: other: desc:工作环境
     * @param name:work_cover type:array require:1 default: other: desc:工作环境图片
     *
     * @return term:专家团队
     * @return term_cover:专家团队配图
     * @return work:工作环境
     * @return work_cover:工作环境图片
     */
    public function update(){
        $data = input('put.');
        $data['id'] = 1;
        $validate = Validate($this->controller);
        if (!$validate->checkRuleByData($data)) {
            $this->responseFail($validate->getError());
        }
        $model = model($this->controller);
        $r = $model->updateSave($data);
        if ($r == false){
            $this->responseFail($model->getError());
        }
        $this->getOne(1);
    }
    public function delete(){}
}